package com.relytosoft.mizar.media.camera.api.pojo.dto;

import com.relytosoft.mizar.media.camera.api.entity.DownLoadLog;
import com.relytosoft.mizar.media.common.enums.DownLoadStateEnum;
import com.relytosoft.mizar.media.common.enums.ResourceTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @author wss
 * @version 1.0
 * @date 2022/6/13 16:17
 */
@ApiModel("设备记录dto")
public class VideoRecordDto implements Serializable {

    @ApiModelProperty(value = "流地址")
    private String streamUrl;

    @ApiModelProperty(value = "设备id")
    private Integer deviceId;

    @ApiModelProperty(value = "持续时长 单位s")
    private Long duration;

    @ApiModelProperty(value = "资源类型")
    private ResourceTypeEnum resourceTypeEnum;

    @ApiModelProperty(value = "开始时间")
    private Long startTime;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    @ApiModelProperty(value = "任务id")
    private Integer taskId;

    @ApiModelProperty(value = "文件路径")
    private String filePath;

    public String getStreamUrl() {
        return streamUrl;
    }

    public void setStreamUrl(String streamUrl) {
        this.streamUrl = streamUrl;
    }

    public Integer getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Integer deviceId) {
        this.deviceId = deviceId;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public static DownLoadLog buildObject(VideoRecordDto videoRecordDto) {
        DownLoadLog downLoadLog = new DownLoadLog();
        downLoadLog.setState(DownLoadStateEnum.CREATING.getValue());
        downLoadLog.setTaskName(videoRecordDto.getTaskName());
        return downLoadLog;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public ResourceTypeEnum getResourceTypeEnum() {
        return resourceTypeEnum;
    }

    public void setResourceTypeEnum(ResourceTypeEnum resourceTypeEnum) {
        this.resourceTypeEnum = resourceTypeEnum;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public Integer getTaskId() {
        return taskId;
    }

    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    @Override
    public String toString() {
        return "VideoRecordDto{" +
                "streamUrl='" + streamUrl + '\'' +
                ", deviceId=" + deviceId +
                ", duration=" + duration +
                ", resourceTypeEnum=" + resourceTypeEnum +
                ", startTime=" + startTime +
                ", taskName='" + taskName + '\'' +
                ", taskId=" + taskId +
                ", filePath='" + filePath + '\'' +
                '}';
    }
}
